function [emo,len] = readExcerptData(excerpt,pathtofiles)

if nargin <2
path1 = '/Volumes/300GB iceCUBE G2/DataEmotion/EmotionExp';
%path2 = '/Volumes/My Book/EmotionExp';
path2 = '/Volumes/HD-LBU2/Student Data';
if exist(path1)
  pathtofiles = path1;
elseif exist(path2)
  pathtofiles = path2;
end

end

% TODO fix this for random excerpts with real lengths. 
if strfind(excerpt, 'Training')
  excerpt = str2num(strrep(excerpt,'Training',''));
    if excerpt == 0
        emo = 'Instructions';
        len = 0;
        return;
    end

  texc = {'Excited','Sad','Happy','Calm','Angry','Scared'};
  lengths = [-1 , -3, -4, -5, -6, -9];
  emo = texc{excerpt};
  len = lengths(excerpt);
  return
end


excerpt = str2num(strrep(excerpt,'excerpt',''));
excerpt = excerpt + 1;
excerpts = {'Excited1_ToyStory.wav'
'Angry1_UpAUD.wav'
'Angry4_ToyStory3.wav'
'Angry5_ToyStory3.wav' 
'Calm1_Nemo.wav'
'Calm2_Nemo.wav'
'Calm3_Nemo.wav'
'Excited4_Cars.wav'
'Excited5_Cars.wav'
'Excited3_Up.wav'
 'Happy1_CarsAUD.wav'
 'Happy2_Monsters.wav' 
 'Happy3_Up.wav'
 'Sad1_Cars.wav'
 'Sad6_ToyStory3.wav'
 'Sad7_ToyStory3.wav'
 'Scared1_Up.wav'
 'Scared2_Up.wav'
 'Scared4_Up.wav'};
for i = 1:19
  
  lengths(i,:) = wavread(['/Volumes/300GB iceCUBE G2/DataEmotion/EmotionExp/PresentedExcerpts/' excerpts{i}], 'size');
end
emotions = {'Excited'
'Angry'
'Angry'
'Angry' 
'Calm'
'Calm'
'Calm'
'Excited'
'Excited'
'Excited'
 'Happy'
 'Happy' 
 'Happy'
 'Sad'
 'Sad'
 'Sad'
 'Scared'
 'Scared'
 'Scared'};


len = lengths(excerpt,1);
emo = emotions{excerpt};

